//
//  SDLevelCell.m
//  Sudoku
//
//  Created by 兰伟欣 on 16/6/12.
//  Copyright © 2016年 wxlan. All rights reserved.
//

#import "SDLevelCell.h"
@interface SDLevelCell()

@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet UILabel *descLabel;

@end

@implementation SDLevelCell

+ (instancetype)levelCellWithTableView:(UITableView *)tableView
{
    static NSString *ID = @"tg";
    

    SDLevelCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    
    if (cell == nil) {
        cell = [[[NSBundle mainBundle] loadNibNamed:@"SDLevelCell" owner:nil options:nil] lastObject];
    }
    return cell;

}

- (void)awakeFromNib {
    [super awakeFromNib];
    self.selectionStyle = UITableViewCellSelectionStyleNone;
    self.nameLabel.textColor = [UIColor whiteColor];
    self.descLabel.textColor = [UIColor whiteColor];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:YES];

    // Configure the view for the selected state
}
- (void)setLevelModel:(SDLevelModel *)levelModel
{
    _levelModel = levelModel;
    self.nameLabel.text = levelModel.name;
    self.descLabel.text = [NSString stringWithFormat:@"%ld 谜团(%ld进行中,%ld未解决)", levelModel.allLevel,levelModel.doingLevel, levelModel.unsolvedLevel];
}

@end
